package com.fast.cms.model.article;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name = "t_cms_MdData")
@DynamicInsert(true)
@DynamicUpdate(true)
public class MdData implements Serializable {

	private static final long serialVersionUID = -4967731498855130634L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false, length = 10)
	private int id = 0;
	@Column(name = "uuid", length = 64)
	private String uuid = "";

	// ============================基本信息===开始======================================
	@Column(name = "data_url", columnDefinition = ("varchar(1024) comment '数据地址'"))
	private String dataUrl = "";
	@Column(name = "data_title", columnDefinition = ("varchar(1024) comment '数据标题'"))
	private String dataTitle = "";
	@Transient
	private String dataTitleVmg = "";
	@Column(name = "data_type", columnDefinition = ("varchar(64) comment '数据类型'"))
	private String dataType = "";
	@Column(name = "is_download", columnDefinition = ("int(2) comment '是否下载过'"))
	private int isDownload = 1;
	@Column(name = "batch_No", columnDefinition = ("varchar(64) comment '所属批次号'"))
	private String batchNo = "";
	@Column(name = "title_gan_ci", columnDefinition = ("varchar(64) comment '标题敏感词'"))
	private String titleGanCi = "";
	@Column(name = "pingpai_gan_ci", columnDefinition = ("varchar(64) comment '品牌敏感词'"))
	private String pingpaiGanCi = "";
	@Column(name = "validate_Flag", columnDefinition = ("int(2) comment '是否进行校验'"))
	private int validateFlag = 0;

	// ==================创建与编辑信息======================
	// 操作信息
	@Column(name = "editor_id", columnDefinition = ("int(10) comment '编辑人ID'"))
	private int editorId = 0;// 编辑人Id
	@Column(name = "editor_name", columnDefinition = ("varchar(64) comment '编辑人'"))
	private String editorName = "";// 编辑人
	@Column(name = "edit_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date editTime;// 编辑时间
	@Column(name = "creater_id", columnDefinition = ("int(10) comment '创建人id'"))
	private int createrId = 0;// 编辑人Id
	@Column(name = "creater", columnDefinition = ("varchar(64) comment '创建人'"))
	private String creater = "";// 编辑人
	@Column(name = "create_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	@Column(name = "delete_flag", columnDefinition = ("int(1) comment '删除标识'"))
	private int deleteFlag = 0;// 默认为不删除，1为删除

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getDataUrl() {
		return dataUrl;
	}

	public void setDataUrl(String dataUrl) {
		this.dataUrl = dataUrl;
	}

	public String getDataTitle() {
		return dataTitle;
	}

	public void setDataTitle(String dataTitle) {
		this.dataTitle = dataTitle;
	}

	public int getEditorId() {
		return editorId;
	}

	public void setEditorId(int editorId) {
		this.editorId = editorId;
	}

	public String getEditorName() {
		return editorName;
	}

	public void setEditorName(String editorName) {
		this.editorName = editorName;
	}

	public Date getEditTime() {
		return editTime;
	}

	public void setEditTime(Date editTime) {
		this.editTime = editTime;
	}

	public int getCreaterId() {
		return createrId;
	}

	public void setCreaterId(int createrId) {
		this.createrId = createrId;
	}

	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public int getDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(int deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public String toString() {
		return "{\"id\":\"" + id + "\", \"uuid\":\"" + uuid + "\", \"dataUrl\":\"" + dataUrl + "\", \"dataTitle\":\""
				+ dataTitle + "\", \"dataTitleVmg\":\"" + dataTitleVmg + "\", \"dataType\":\"" + dataType
				+ "\", \"isDownload\":\"" + isDownload + "\", \"batchNo\":\"" + batchNo + "\", \"titleGanCi\":\""
				+ titleGanCi + "\", \"pingpaiGanCi\":\"" + pingpaiGanCi + "\", \"validateFlag\":\"" + validateFlag
				+ "\", \"editorId\":\"" + editorId + "\", \"editorName\":\"" + editorName + "\", \"editTime\":\""
				+ editTime + "\", \"createrId\":\"" + createrId + "\", \"creater\":\"" + creater
				+ "\", \"createTime\":\"" + createTime + "\", \"deleteFlag\":\"" + deleteFlag + "\"}";
	}

	public String getDataType() {
		return dataType;
	}

	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

	public int getIsDownload() {
		return isDownload;
	}

	public void setIsDownload(int isDownload) {
		this.isDownload = isDownload;
	}

	public String getBatchNo() {
		return batchNo;
	}

	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}

	public String getTitleGanCi() {
		return titleGanCi;
	}

	public void setTitleGanCi(String titleGanCi) {
		this.titleGanCi = titleGanCi;
	}

	public String getPingpaiGanCi() {
		return pingpaiGanCi;
	}

	public void setPingpaiGanCi(String pingpaiGanCi) {
		this.pingpaiGanCi = pingpaiGanCi;
	}

	public String getDataTitleVmg() {
		return dataTitleVmg;
	}

	public void setDataTitleVmg(String dataTitleVmg) {
		this.dataTitleVmg = dataTitleVmg;
	}

	public int getValidateFlag() {
		return validateFlag;
	}

	public void setValidateFlag(int validateFlag) {
		this.validateFlag = validateFlag;
	}

}
